package com.bmth.alise.crawler;

import org.apache.commons.lang.StringUtils;

import com.bmth.alise.utils.MQReceiver;
import com.bmth.alise.utils.MQSender;
import com.bmth.alise.utils.QueueUtils;

public class Bootstrap {

	public static void main(String[] args) {

		for (int i = 0; i < 50; i++) {
			String randomQueue = null;

			String url = "";
			do {
				randomQueue = QueueUtils.randomQueue();
				url = MQReceiver.getInstance().receive(randomQueue);
			} while (StringUtils.isBlank(url));

			System.out.println(i + "	" + randomQueue + "		>> " + url);
			MQSender.getInstance().send("Seeds", url);
			System.out.println("--over--");
		}

		// MQSender.getInstance().send("Seeds", "http://www.csdn.net/");
		// System.out.println("---over---");
	}
}
